<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>成品库出库管理</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="stylesheet" href="${pageContext.request.contextPath }/assets/css/layui.css"  media="all">
	<link rel="stylesheet" href="${pageContext.request.contextPath }/assets/css/toastr.min.css"  media="all">
</head>
<body>
<div class="demoTable" style="padding:10px 0 0 15px">
    <div class="layui-inline">
        <input class="layui-input" name="keyword" id="keyword" autocomplete="off" placeholder="请输入订单号">
    </div>
    <button class="layui-btn layui-btn-blue" style="margin: 0 0 0 10px" data-type="reload"><i class="layui-icon layui-icon-search">  搜索</i></button>
</div>
<table class="layui-hide" id="test" lay-filter="test"></table>
<table class="layui-hide" id="testDetial" lay-filter="testDetial"></table>
 
<script type="text/html" id="toolbarDemo">
</script>
              
          
<script src="${pageContext.request.contextPath }/assets/layui.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath }/assets/layui.all.js"></script>
<script src="${pageContext.request.contextPath }/assets/js/jquery.min.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath }/assets/js/toastr.min.js" charset="utf-8"></script>
<jsp:include page="ScriptInc.jsp"></jsp:include>
 
<script>
layui.use(['table','layer','upload','form'], function(){
	var table = layui.table;
	var layer = layui.layer,
    form = layui.form;
	
	var $ = layui.jquery, active = {
			reload:function () {
				var keyword = $("#keyword").val();
				table.reload('contenttable',{
					method:'get',
					where:{orderSN: keyword}
				});
			}
		}
	$('.layui-btn').on('click', function(){
        var type = $(this).data('type');
        active[type] ? active[type].call(this) : '';
    });
	table.render({
	    elem: '#test'
	    ,url:'${pageContext.request.contextPath }/finishProductLibraryOut/listPageFinishProductLibraryOut.do'
	    ,toolbar: '#toolbarDemo'
	    ,title: '成品库出库数据表'
	    ,id :'contenttable'
	    ,limits:[10,20,30]
	    ,cols: [[
	      {type: 'checkbox', fixed: 'left'}
	      ,{type: 'numbers', title:'序号', fixed: 'left', width:'5%', unresize: true, sort: true}
	      ,{field:'outDate', title:'出库日期', templet: function(d){
	          return timestampToDate(d.outDate.time);
	      }}
	      ,{field:'quantity', title:'数量'}
	      ,{field:'componentCode', title:'组件码'}
	      ,{field:'unicode', title:'统一码'}
	    ]]
	    ,page: true
	});
	
	//监听行单击事件
	table.on('row(test)', function(obj){
	  table.render({
		    elem: '#testDetial'
		    ,url:'${pageContext.request.contextPath }/outDetail/listPageFinishProductLibraryOutDetail.do'
		    ,where:{fplOutID: obj.data.fplOutID}
		    ,title: '成品库出库详情数据表'
		    ,id :'contentDetialTable'
		    ,limits:[10,20,30]
		    ,cols: [[
		      {type: 'numbers', fixed: 'left', title:'序号'}
		      ,{field:'pnum', title:'产品编号'}
		      ,{field:'pname', title:'产品名称'}
		      ,{field:'pmodel', title:'规格型号'}
		      ,{field:'punit', title:'主计量单位'}
		      ,{field:'outQuantity', title:'出库数量'}
		    ]]
		    ,page: true
		});
	});
});

toastr.options.positionClass = 'toast-top-center'; //提示框的位置设置为中上
</script>

</body>
</html>